                                                                                
 MODULE mod_chem_spack_fexloss                                                  
                                                                                
   IMPLICIT NONE                                                                
   PRIVATE                                                                      
   PUBLIC :: fexloss ! subroutine                                               
 CONTAINS                                                                       
                                                                                
   SUBROUTINE fexloss(dw,loss,ngas,ijkbegin,ijkend,maxblock_size,nr)            
                                                                                
!------------------------------------------------------------------------       
!                                                                               
!     -- DESCRIPTION                                                            
!                                                                               
!     This routine computes the chemical loss  term L in a P-Lc formulation.    
!     This routine is automatically generated by SPACK.                         
!     Mechanism: ../Mechanism/LPCE2                                             
!     Species: ../Mechanism/ciLPCE2                                             
!                                                                               
!------------------------------------------------------------------------       
!                                                                               
!     -- INPUT VARIABLES                                                        
!                                                                               
!     DW: derivative of reaction rates wrt Y.                                   
!                                                                               
!     -- INPUT/OUTPUT VARIABLES                                                 
!                                                                               
!     -- OUTPUT VARIABLES                                                       
!                                                                               
!     LOSS: array of chemical loss terms.                                       
!                                                                               
!------------------------------------------------------------------------       
!                                                                               
!     -- REMARKS                                                                
!                                                                               
!------------------------------------------------------------------------       
!                                                                               
!     -- MODIFICATIONS                                                          
!                                                                               
!------------------------------------------------------------------------       
!                                                                               
!     -- AUTHOR(S)                                                              
!                                                                               
!     SPACK.                                                                    
!                                                                               
!------------------------------------------------------------------------       
                                                                                
                                                                                
                                                                                
       IMPLICIT NONE                                                            
                                                                                
     INTEGER	       , INTENT(IN)  :: NGAS	                                      
     INTEGER	       , INTENT(IN)  :: ijkbegin		                                 
     INTEGER	       , INTENT(IN)  :: ijkend			                                  
     INTEGER	       , INTENT(IN)  :: maxblock_size		                            
     INTEGER	       , INTENT(IN)  :: nr		 	                                     
     DOUBLE PRECISION , INTENT(IN)  :: dw(maxblock_size,nr,NGAS)                
     DOUBLE PRECISION , INTENT(OUT) :: loss(maxblock_size,NGAS)                 
     INTEGER :: ijk						                                                       
                                                                                
                                                                                
!     Chemical loss terms.                                                      
                                                                                
      DO ijk=ijkbegin,ijkend                                                    
      loss(ijk,  1) = + dw(ijk,  1,  1) &
          + dw(ijk,  2,  1)
      loss(ijk,  2) = + dw(ijk,  1,  2)
      loss(ijk,  3) = + dw(ijk,  2,  3)
      END DO   
                                                                                
   END SUBROUTINE fexloss                                                       
                                                                                
  END MODULE mod_chem_spack_fexloss                                             
                                                                                
